home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / eulisp / mpfeel.lha / MPFeel / Plurals / mp_eubang.h < prev    next >
C/C++ Source or Header  |  1992-07-15  |  5KB  |  204 lines

  1. /*
  2.  *    Plurals
  3.  *
  4.  *    Author:    S.C.Merrall
  5.  *
  6.  *    File:    mp_eubang.h
  7.  *
  8.  *    Contents:    
  9.  *
  10.  *    Description:       This is the point of contact of the front end
  11.  *            with the back end of the plurals interface.
  12.  *
  13.  *    Change History:
  14.  *
  15.  *    Date   Name Comment
  16.  *    -------- ---- -------
  17.  *    21:05:91 SCM  Created
  18.  *    22:05:91 SCM  included constant.h and mp_type.h, added MASPAR_CONFIG
  19.  *    23:05:91 SCM  Added mp_error for error handling between ends
  20.  *    26:01:92 SCM  Added mp_gc, this will probably need to be removed later
  21.  *    26:03:92 SCM  Added mp_free_plurals, called by fe_gc
  22.  *    26:03:92 SCM  Removed cm_identifym superceded by cm_put and cm_start
  23.  *    08:04:92 SCM  plural space now visible to implement temp pspace in lisp
  24.  */
  25.  
  26. /*  Include Some other useful headers here
  27.  *  This way we only have to include mp_eubang.h in eubang.c
  28.  */
  29.  
  30. #include "constant.h"           /*  So we know the scratch space size   */
  31. #include "mp_type.h"            /*  So we can share the unique type ids */
  32. #include "mp_arith.h"           /*  So we know the bin-op ids           */
  33.  
  34. #define MASPAR_CONFIG 1024    /*  Have to tell the front end for its 
  35.                  *  scratch space. Put check in mp_init
  36.                  *  to make sure they agree.
  37.                  */
  38.  
  39. #define MASPAR_XLEN 32
  40. #define MASPAR_YLEN 32
  41.  
  42. /*  Failure is indicated by returning NULL/FAIL 
  43.  *  The specific nature of the failure can be indicated by setting
  44.  *  mp_error, which is visible to the front end.
  45.  */
  46.  
  47. extern int private_nproc;
  48. extern int mp_error;
  49.  
  50. /*  Error codes */
  51. /*  ===== ===== */
  52.  
  53.  
  54. #define MP_WRONG_MASPAR_CONFIG  999    /*  Front end code compiled for wrong  
  55.                      *  Maspar Configuration
  56.                      */
  57. #define UNKNOWN_TYPE        997    /*  Unsupported type sent to encoder */
  58. #define EXCEEDED_SCRATCH_SPACE    996    /*  Ran out of space whilst encoding */
  59.  
  60. #define MP_COPY_IN_FAILED    995    /*  botch in cifer or plural free */
  61.  
  62. #define MP_ALLOC_PLURAL_FAILED    800    
  63. #define MP_NONCONFORMANT_ARGS   801
  64. #define MP_INDEX_OUTSIDE_PLURAL 802
  65. #define MP_READ_FROM_FE_FAIL    803
  66. #define MP_BUILD_STRUCTURE_FAIL 804
  67. #define MP_MAKE_STACK_FAILED    806
  68. #define MP_ALLOC_STACK_FAILED   807
  69. #define MP_CAR_OF_CONTEXT_FAIL  808
  70. #define MP_ALLOC_CONTEXT_FAILED 809
  71.  
  72. #define MP_CAR_OF_MAP_FAILED    810
  73. #define MP_CDR_OF_MAP_FAILED    811
  74. #define MP_DECODE_IN_MOVE_FAILED 812
  75. #define MP_MAP_SOURCE_NOT_INTS  813
  76. #define MP_MAP_DEST_NOT_INTS    814
  77. #define MP_CONS_COLLISIONS_FAILED 815
  78. #define MP_DECODE_IN_GET_FAILED 816
  79.  
  80. #define MP_CONS_FAILED        700
  81. #define MP_CAR_FAILED        701
  82. #define MP_CDR_FAILED        702
  83. #define MP_RPLAC_A_FAILED    703
  84. #define MP_RPLAC_D_FAILED    704
  85.  
  86. #define MP_IF_FAILED            600
  87. #define MP_FI_FAILED            601
  88. #define MP_ELSE_FAILED        602
  89. #define MP_ASSIGN_FAILED    603
  90. #define MP_CONTEXT              604
  91. #define MP_AND_FAILED        605
  92. #define MP_OR_FAILED        606
  93. #define MP_ELIF_FAILED          607
  94. #define MP_NOT_FAILED           608
  95.  
  96. #define MP_BIN_OP_FAILED    500
  97. #define MP_INT_BIN_OP_FAILED    500
  98. #define MP_UN_OP_FAILED         501
  99. #define MP_REL_OP_FAILED        502
  100. #define MP_RND_FAILED        503
  101.  
  102. #define MP_TEST_FAILED        400
  103. #define MP_EQ_FAILED        401
  104.  
  105. #define MP_MAKE_VECTOR_FAILED    300
  106. #define MP_VECTOR_LENGTH_FAILED 301
  107. #define MP_VECTOR_REF_FAILED    302
  108. #define MP_VECTOR_SET_FAILED    303
  109. #define MP_VECTOR_MERGE_FAILED  304
  110.  
  111.  
  112. /* Visible thingies */
  113. /* ======= ======== */
  114.  
  115. extern unsigned short plural_space;
  116. extern unsigned short stack_base;
  117.  
  118. #ifdef __STDC__
  119.  
  120. extern char *mp_make_plural( char *, int );
  121. extern int   mp_make_context( char *, int );
  122. extern int   mp_plural( int, int, int, char *, ... );
  123. extern char *mp_init_plural( void );
  124. extern int   mp_length( char * );
  125. extern int   mp_match(char *, int, char *, int);
  126. extern int   mp_move(char *, int, char *, int, int);
  127.  
  128. extern void  mp_gc( void );
  129. extern int   mp_free_plurals( char *, int );
  130.  
  131. extern int   cm_put( char *, int, int, char * );
  132. extern int   cm_start( char * );
  133.  
  134. extern mp_xnet( char *, int, int, char * );
  135. extern mp_edge( char *, int );
  136.  
  137. #else
  138.  
  139. extern char *mp_make_context();
  140. extern int   mp_make_plural();
  141. extern int   mp_plural();
  142. extern char *mp_init_plural();
  143. extern int   mp_length();
  144. extern int   mp_match();
  145. extern int   mp_move();
  146.  
  147. extern void  mp_gc();
  148. extern int   mp_free_plurals();
  149.  
  150. extern int   cm_put();
  151. extern int   cm_start();
  152.  
  153. extern int mp_xnet();
  154. extern int mp_edge();
  155.  
  156. #endif
  157.  
  158. /* Unique Operator ID's */
  159. /* ====== ======== ==== */
  160.  
  161. #define MP_PRINT     100
  162. #define MP_X_STAT       101
  163.  
  164. #define MP_MP_CONS      200
  165. #define MP_CAR        201
  166. #define MP_CDR        202
  167. #define MP_RPLAC_A    203
  168. #define MP_RPLAC_D    204
  169.  
  170. #define MP_SET        300
  171. #define MP_REF          301
  172.  
  173. #define MP_BANG        400
  174.  
  175. #define MP_IF           500
  176. #define MP_FI           501
  177. #define MP_ELSE        502
  178. #define MP_ASSIGN    503
  179. #define MP_REDUCE_OR    504
  180. #define MP_AND        505
  181. #define MP_OR        506
  182. #define MP_ELIF         507
  183. #define MP_NOT          508
  184.  
  185. #define MP_INT_BIN_OP   600
  186. #define MP_FLOAT_BIN_OP 601
  187. #define MP_BIN_OP       602
  188. #define MP_UN_OP        603
  189. /*#define MP_SCAN_OP      604  used by MP_CONTEXT */
  190. #define MP_REL_OP       605
  191. #define MP_SCAN_OP      606
  192. #define MP_RANDOM       607
  193.  
  194. #define MP_TEST        700
  195. #define MP_EQ        701
  196.  
  197. #define MP_MAKE_VECTOR    800
  198. #define MP_VECTOR_LENGTH 801
  199. #define MP_VECTOR_REF    802
  200. #define MP_VECTOR_SET    803
  201. #define MP_VECTOR_MERGE 804
  202.  
  203. #define MP_GREEN         0
  204.